package com.silence.gankio.net

import com.silence.gankio.bean.GankIoBean
import com.silence.gankio.mvvm.viewModel.BaseViewModel

abstract class GankIoObjectObserver<T>(mViewModel: BaseViewModel) : BaseBindingObserver<GankIoBean<T>>(mViewModel) {

    override fun onNext(t: GankIoBean<T>) {
        onSuccess(t.results)
    }

    /**
     * 根据具体的Api 业务逻辑去重写 onSuccess 方法！Error 是选择重写，but 必须Super ！
     *
     * @param t
     */
    abstract fun onSuccess(t: List<T>?)

}